#pragma once

int ShowConfigWindow(vector<PlugProp>& Props,HWND ParentHwnd);

class PropControl
{
public:
	PropControl()
	{
		Ctrl1=0;
		Ctrl2=0;
	}
	~PropControl()
	{
		EnvFun::ReleaseDynID(Ctrl1->GetDlgCtrlID());
		EnvFun::ReleaseDynID(Ctrl2->GetDlgCtrlID());
		mfree(Ctrl1);
		mfree(Ctrl2);
	}
	int Type;
	CWnd* Ctrl1;
	CWnd* Ctrl2;
};

class CPropDlg:public CDialog
{
public:
	enum IDD
	{
		IDC_BTN_PROP_OK=12000,
		IDC_BTN_PROP_CANCEL
	};
public:
	CPropDlg();
	~CPropDlg();
	BOOL OnInitDialog();
	void AddControl(PlugProp* Prop,int ID);
	CString GetControlValue(int ID);
	vector<PlugProp>* m_pvctProps;
	vector<PropControl*> m_vctControls;
	DECLARE_MESSAGE_MAP()
	afx_msg void OnPaint();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	CButton m_BtnOk;
	CButton m_BtnCancel;
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBnClickedBtnOk();
	afx_msg void OnBnClickedBtnCancel();
};
